package com.jxl.controller.user;

import com.jxl.common.result.Result;
import com.jxl.pojo.vo.DailyWarmPostVO;
import com.jxl.service.DailyWarmPostService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userDailyWarmPostController")
@Slf4j
@Api(tags = "每日暖帖管理接口")
@RequestMapping("/user/dailyWarmPosts")
public class DailyWarmPostController {
    @Autowired
    private DailyWarmPostService dailyWarmPostService;

    /**
     * 查询所有的可被展示的每日暖帖
     * @return
     */
    @GetMapping
    public Result<List<DailyWarmPostVO>> getAllDailyWarmPosts() {
        log.info("查询所有的可被展示的每日暖帖");
        List<DailyWarmPostVO> dailyWarmPostVOList=dailyWarmPostService.getAllDailyWarmPosts();
        return Result.success(dailyWarmPostVOList);
    }
}
